﻿---执行此脚本   消除EF检测模型元数据的时候 进行数据库中的模型版本变更

IF	EXISTS (SELECT * FROM  sysobjects WHERE type='U' AND name='__MigrationHistory')
DROP TABLE __MigrationHistory

CREATE TABLE [dbo].[__MigrationHistory]
    (
      [MigrationId] [nvarchar](150) NOT NULL ,
      [ContextKey] [nvarchar](300) NOT NULL ,
      [Model] [varbinary](MAX) NOT NULL ,
      [ProductVersion] [nvarchar](32) NOT NULL ,
       CONSTRAINT [PKConsPrimarykey_MigrationId_ContexKey] PRIMARY KEY CLUSTERED 
(
	[MigrationId] ASC,
	[ContextKey] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

    